package site

import (
	"sensitives/databases/mysql"
)

type SensitiveUgc struct {
	Word  string `gorm:"type:varchar(50);unique_index"`
	Level uint8  `gorm:"type:tinyint(1)`
}

func (SensitiveUgc) TableName() string {
	return "sensitive_ugc"
}

func GetUgcWords(site int) []SensitiveUgc {
	ugcwords := make([]SensitiveUgc, 0)
	db, err := mysql.GetSiteConnection(site)
	if err != nil {
		return ugcwords
	}
	db.Find(&ugcwords)
	return ugcwords
}
